﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;

namespace PresentacionWindows.Base
{
	/// <summary>
	/// Formulario de visualización de reports
	/// </summary>
	[System.ComponentModel.DesignerCategory("Designer")]
	public class frmVisorReports : Base.FormBase
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private CrystalDecisions.Windows.Forms.CrystalReportViewer viewer;

		private ReportDocument informe;
		
		/// <summary>
		/// Informe que se visualiza
		/// </summary>
		public ReportDocument Informe 
		{
			get { return informe; }
			set { informe = value; }
		}

		public frmVisorReports()
		{

			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			/*
			this.Font = ConfigUI.Fuente;
			this.viewer.BackColor = ConfigUI.ColorFondoForm;
			this.viewer.ForeColor = ConfigUI.ColorLetraForm;
			*/
			this.BackColor = Color.FromKnownColor(KnownColor.Control);
			this.ForeColor = Color.FromKnownColor(KnownColor.ControlText);
	

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.viewer = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
			this.SuspendLayout();
			// 
			// viewer
			// 
			this.viewer.ActiveViewIndex = -1;
			this.viewer.DisplayBackgroundEdge = false;
			this.viewer.DisplayGroupTree = false;
			this.viewer.Dock = System.Windows.Forms.DockStyle.Fill;
			this.viewer.EnableDrillDown = false;
			this.viewer.Name = "viewer";
			this.viewer.ReportSource = null;
			this.viewer.ShowCloseButton = false;
			this.viewer.ShowGroupTreeButton = false;
			this.viewer.ShowRefreshButton = false;
			this.viewer.Size = new System.Drawing.Size(390, 359);
			this.viewer.TabIndex = 0;
			// 
			// frmVisorReports
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(390, 359);
			this.ControlBox = true;
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.viewer});
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
			this.MaximizeBox = true;
			this.MinimizeBox = true;
			this.Name = "frmVisorReports";
			this.Text = "Vista previa";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.Load += new System.EventHandler(this.frmVisorReports_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void frmVisorReports_Load(object sender, System.EventArgs e)
		{
			viewer.ReportSource = informe;
		}
	}
}
